#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <stddef.h>

#define my_offsetof(type,member) (size_t)&(((type*)0)->member)

struct STU {
	char ch1;
	int num;
	char ch2;
};
int main() {
	struct STU st = { 'a',10,'b' };
	printf("%d\n", my_offsetof(struct STU, ch1));
	printf("%d\n", my_offsetof(struct STU, num));
	printf("%d\n", my_offsetof(struct STU, ch2));
	return 0;
}